<?php
require '../../common/initPage.php';
require '../../common/dbcon.php';
require '../../common/func.php';

session_start();
//拦截未登录
filterLogout();

//网站用户数量
$allUserRes = $mysqlCon->query(queryAllUser);
$allUserNums = $allUserRes->num_rows;
//七天内登录人数
$LastLoginUserRes = $mysqlCon->query(queryUserLastLoginNumsSQL);
$LastLoginUserNums = $LastLoginUserRes->num_rows;
//用户活跃度=七天内登录人数/网站用户数量
if($allUserNums!=0){
    $UserActivity=round($LastLoginUserNums/$allUserNums*100,2) ;
}else{
    $UserActivity=0;
}

$routerUrl = '../../views/admin/home.html';
if($_SESSION['loginIden']=='管理员'){
    require '../../views/admin/template.html';
}else{
    require '../../views/user/template.html';
}